const Koa = require('koa');
const Router = require('koa-router');
const bodyParser = require('koa-bodyparser')();
const app = new Koa();
const router = new Router();
const cors = require('./utils/cors');
const parsePostData = require('./utils/index.js');
const user = require('./admin/user');

app.use(cors)

// 利用body-parser中间件解析formData数据
app.use(bodyParser);

app.use(parsePostData);

app.use(user);

app.listen(3000, () => {
    console.log('服务已开启');
});